package o;

import java.math.BigInteger;

public final class atj extends ath {
    private static final Class<?>[] ˊ = new Class[]{Integer.TYPE, Long.TYPE, Short.TYPE, Float.TYPE, Double.TYPE, Byte.TYPE, Boolean.TYPE, Character.TYPE, Integer.class, Long.class, Short.class, Float.class, Double.class, Byte.class, Boolean.class, Character.class};
    private Object ˏ;

    public atj(Boolean bool) {
        ˊ(bool);
    }

    public atj(Number number) {
        ˊ(number);
    }

    public atj(String str) {
        ˊ(str);
    }

    void ˊ(Object obj) {
        if (obj instanceof Character) {
            this.ˏ = String.valueOf(((Character) obj).charValue());
            return;
        }
        boolean z = (obj instanceof Number) || ˏ(obj);
        atr.ˊ(z);
        this.ˏ = obj;
    }

    public boolean ˊॱ() {
        return this.ˏ instanceof Boolean;
    }

    Boolean ॱˊ() {
        return (Boolean) this.ˏ;
    }

    public boolean ʻ() {
        if (ˊॱ()) {
            return ॱˊ().booleanValue();
        }
        return Boolean.parseBoolean(ˏ());
    }

    public boolean ॱˋ() {
        return this.ˏ instanceof Number;
    }

    public Number ॱ() {
        return this.ˏ instanceof String ? new atu((String) this.ˏ) : (Number) this.ˏ;
    }

    public boolean ॱˎ() {
        return this.ˏ instanceof String;
    }

    public String ˏ() {
        if (ॱˋ()) {
            return ॱ().toString();
        }
        if (ˊॱ()) {
            return ॱˊ().toString();
        }
        return (String) this.ˏ;
    }

    public double ˋ() {
        return ॱˋ() ? ॱ().doubleValue() : Double.parseDouble(ˏ());
    }

    public long ˊ() {
        return ॱˋ() ? ॱ().longValue() : Long.parseLong(ˏ());
    }

    public int ˎ() {
        return ॱˋ() ? ॱ().intValue() : Integer.parseInt(ˏ());
    }

    private static boolean ˏ(Object obj) {
        if (obj instanceof String) {
            return true;
        }
        Class cls = obj.getClass();
        for (Class isAssignableFrom : ˊ) {
            if (isAssignableFrom.isAssignableFrom(cls)) {
                return true;
            }
        }
        return false;
    }

    public int hashCode() {
        if (this.ˏ == null) {
            return 31;
        }
        long longValue;
        if (ॱ(this)) {
            longValue = ॱ().longValue();
            return (int) (longValue ^ (longValue >>> 32));
        } else if (!(this.ˏ instanceof Number)) {
            return this.ˏ.hashCode();
        } else {
            longValue = Double.doubleToLongBits(ॱ().doubleValue());
            return (int) (longValue ^ (longValue >>> 32));
        }
    }

    public boolean equals(Object obj) {
        boolean z = false;
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        atj o_atj = (atj) obj;
        if (this.ˏ == null) {
            if (o_atj.ˏ != null) {
                return false;
            }
            return true;
        } else if (ॱ(this) && ॱ(o_atj)) {
            if (ॱ().longValue() != o_atj.ॱ().longValue()) {
                return false;
            }
            return true;
        } else if (!(this.ˏ instanceof Number) || !(o_atj.ˏ instanceof Number)) {
            return this.ˏ.equals(o_atj.ˏ);
        } else {
            double doubleValue = ॱ().doubleValue();
            double doubleValue2 = o_atj.ॱ().doubleValue();
            if (doubleValue == doubleValue2 || (Double.isNaN(doubleValue) && Double.isNaN(doubleValue2))) {
                z = true;
            }
            return z;
        }
    }

    private static boolean ॱ(atj o_atj) {
        if (!(o_atj.ˏ instanceof Number)) {
            return false;
        }
        Number number = (Number) o_atj.ˏ;
        if ((number instanceof BigInteger) || (number instanceof Long) || (number instanceof Integer) || (number instanceof Short) || (number instanceof Byte)) {
            return true;
        }
        return false;
    }
}
